package com.bawei.library_network.interceptor

import okhttp3.Interceptor
import okhttp3.Response
import java.util.*

/**
 * @Author : ytx
 * @Time : On 2023/5/20 08:35
 * @Description : HeaderInterceptor:请求头配置拦截器
 */
class HeaderInterceptor:Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        var  request = chain.request().newBuilder().apply {
                header("model", "Android")
                header("If-Modified-Since", "${Date()}")
                header("User-Agent", System.getProperty("http.agent") ?: "unknown")
            }
            .build()
        return chain.proceed(request)
    }
}